Skip to content

Minor fixes and adjustments to the PHPCS 4.0 upgrade guides #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 12, 2025

Conversation

rodrigoprimo
Copy link
Contributor

Description

This PR makes some minor fixes and adjustments to the two PHPCS 4.0 upgrade guides.

Related issues/external references

Fixes #2

Copy link

github-actions bot commented Aug 8, 2025

=== This is an auto-generated comment ===

Thank you for your PR.
A dry-run has been executed on your PR, executing all markdown pre-processing for the wiki files.

Please review the resulting final markdown files via the created artifact.
This is especially important when adding new pages or updating auto-generated output blocks.

N.B.: the above link will automatically be updated when this PR is updated.

@rodrigoprimo
Copy link
Contributor Author

I believe the CS / Check links CI job that is failing is not related to the changes suggested in this PR.

@jrfnl
Copy link
Member

jrfnl commented Aug 8, 2025

I believe the CS / Check links CI job that is failing is not related to the changes suggested in this PR.

Indeed. Might be related to a change in Lychee. If the build on the main branch also fails once this is merged, I guess I'll have to look into this.

@jrfnl jrfnl changed the title Minor fixes and adjustaments to the PHPCS 4.0 upgrade guides Minor fixes and adjustments to the PHPCS 4.0 upgrade guides Aug 8, 2025
Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @rodrigoprimo ! Left feedback on a few things, most of it looks okay though.

Typically, these type of workarounds can be found by searching for calls to the `Ruleset::registerSniffs()` method.
Typically, these types of workarounds can be found by searching for calls to the `Ruleset::registerSniffs()` method.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one. I believe singular is correct here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure as well, and thus I'm ok to leave it as is. Grammarly marks it as an agreement mistake, but it could be a false positive.

An alternative might be "Typically, these workarounds can be found by searching for calls to the Ruleset::registerSniffs() method." or even "Typically, these can be found by searching for calls to the Ruleset::registerSniffs() method."

Copy link
Member

@jrfnl jrfnl Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest leaving it as is (as in: the original text).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I reverted my change.

@@ -352,7 +352,7 @@ Previously a ruleset could already "extend" an array property for a sniff set by

As of PHP_CodeSniffer 4.0, a ruleset can also "extend" the default value of an array property as set in the sniff itself.

The upside of this is, that if you want to default value + some extras, you no longer need to duplicate the default values from sniff array properties in your ruleset.
The upside of this is that if you want the default value + some extras, you no longer need to duplicate the default value from a sniff array property in your ruleset.
Copy link
Member

@jrfnl jrfnl Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I intended to write "want to use the default value + ..."

As for the change in the second part of the sentence... I still think plural is correct here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I intended to write "want to use the default value + ..."

So something like the sentence below?

"The upside of this is that, if you want to use the default value + some extras, you no longer need to duplicate the default values from sniff array properties in your ruleset."

As for the change in the second part of the sentence... I still think plural correct here.

I'm not sure about this one as well. In the version that I suggested above, plural seems correct to me as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed sentence looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I updated the sentence with the proposal we discussed.

@jrfnl
Copy link
Member

jrfnl commented Aug 10, 2025

Might be related to a change in Lychee. If the build on the main branch also fails once this is merged, I guess I'll have to look into this.

Confirmed as an upstream issue introduced in Lychee 0.19.0.
I have now reported the issue in lycheeverse/lychee#1788

@jrfnl
Copy link
Member

jrfnl commented Aug 10, 2025

@rodrigoprimo I've now pulled & merged a fix which will prevent the build failure. Could you please rebase the PR when you address the review feedback ? That should get you a passing build.

@rodrigoprimo rodrigoprimo force-pushed the phpcs-4-upgrade-guides branch from d830cd4 to b8931a5 Compare August 11, 2025 10:47
@rodrigoprimo
Copy link
Contributor Author

@rodrigoprimo I've now pulled & merged a fix which will prevent the build failure. Could you please rebase the PR when you address the review feedback ? That should get you a passing build.

Rebased without changes to get the build passing. I responded to your comments, but still haven't made any changes as there are some details that I would like to discuss with you.

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rodrigoprimo !

@jrfnl jrfnl merged commit 25f5587 into main Aug 12, 2025
14 checks passed
@jrfnl jrfnl deleted the phpcs-4-upgrade-guides branch August 12, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Suggesting some minor changes to the PHPCS 4.0 upgrade guides
2 participants